﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using EpsiRisk.MoteurJeu;

namespace EpsiRisk.AffichageJeu
{
    public class ClassZoneSoundState : ClassZone
    {
        static Texture2D soundOn;
        static Texture2D soundOff;

        public ClassZoneSoundState()
        {
            backcolor = Color.BurlyWood;
            position = new Vector2(325, 325);
            width = 40;
            height = 40;
        }


        internal override void initialiser(ContentManager content)
        {
            soundOn = content.Load<Texture2D>("Sprites/sound");
            soundOff = content.Load<Texture2D>("Sprites/sound_muted");
        }

        internal override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Begin();
            if (ClassSon.BackMusicVolume == 0)
            {
                spriteBatch.Draw(soundOff, new Rectangle((int)position.X, (int)position.Y, width, height), Color.White);
            }
            else
            {
                spriteBatch.Draw(soundOn, new Rectangle((int)position.X, (int)position.Y, width, height), Color.White);
            }
            spriteBatch.End();
        }

        internal override void clicXY(int x, int y)
        {
            if (ClassSon.BackMusicVolume == 0)
            {
                ClassSon.BackMusicVolume = 100;
            }
            else
            {
                ClassSon.BackMusicVolume = 0;
            }
        }
    }
}
